import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:wallet_utils/color.dart';
import 'package:wallet_utils/text_style.dart';

class ShowImagePhoto {
  static void showImgDialog(
      BuildContext context, var onTakePhoto, var onOpenGallery) {
    showModalBottomSheet(
        context: context,
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.only(
            topLeft: Radius.circular(10.r),
            topRight: Radius.circular(10.r),
          ),
        ),
        builder: (BuildContext context) {
          return ClipRRect(
            borderRadius: BorderRadius.only(
              topLeft: Radius.circular(10.r),
              topRight: Radius.circular(10.r),
            ),
            child: Container(
              height: 166.5.w + MediaQuery.of(context).padding.bottom,
              padding: EdgeInsets.only(
                  bottom: MediaQuery.of(context).padding.bottom),
              color: ColorManager.colorFFFFFF,
              child: Column(
                children: <Widget>[
                  InkWell(
                    onTap: onTakePhoto,
                    child: SizedBox(
                      height: 52.w,
                      child: Center(
                        child: Text(
                          '拍照上传',
                          style: TextStyleUtils.style4d4d4d(fontSize: 16.sp),
                        ),
                      ),
                    ),
                  ),
                  Divider(
                    height: 0.5.w,
                  ),
                  InkWell(
                    onTap: onOpenGallery,
                    child: SizedBox(
                      height: 52.w,
                      child: Center(
                        child: Text(
                          '相册选取',
                          style: TextStyleUtils.style4d4d4d(fontSize: 16.sp),
                        ),
                      ),
                    ),
                  ),
                  Container(
                    color: ColorManager.colorFAFAFA,
                    height: 10.w,
                  ),
                  InkWell(
                    onTap: () {
                      Get.back();
                    },
                    child: Container(
                      height: 52.w,
                      color: ColorManager.colorFFFFFF,
                      child: Center(
                        child: Text('取消',
                            style: TextStyleUtils.style999999(fontSize: 16.sp)),
                      ),
                    ),
                  ),
                ],
              ),
            ),
          );
        });
  }
}
